#pragma once

#include <stdio.h>
#include <string.h>
#include <core/thread.h>


#define BARLEN 50

#define CountVal ((nLen - pBar->nMin + 1) * 100 / (pBar->nMax - pBar->nMin + 1))
#define CountBarOff ((nLen - pBar->nMin + 1) * BARLEN / (pBar->nMax - pBar->nMin + 1))

struct ProgressBar
{
	UINT32 nMin;
	UINT32 nMax;
	UINT32 nCurr;

	char cBar[];
};

int CreateProgressBar(struct ProgressBar **ppNew, UINT32 nMin, UINT32 nMax);

void SetVal(struct ProgressBar *pBar, UINT32 nLen);

int DeleteBar(struct ProgressBar *pBar);
